package com.web.onirigi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.web.onirigi.dao.ImageDisDao;
import com.web.onirigi.model.ImageDisplayBean;
import com.web.onirigi.service.ImageDisService;

/**
 * 轮播图service
 * @author ASUS
 * 创建时间  2017年10月8日 上午9:50:24
 *
 */
@Service
public class ImageDisServiceImpl implements ImageDisService {

	@Autowired
	private ImageDisDao  imageDisDao;
	
	@Override
	public Integer addImageDis(ImageDisplayBean bean) {
		return imageDisDao.addImageDis(bean);
	}

	@Override
	public Integer deleteImageDis(ImageDisplayBean bean) {
		return imageDisDao.deleteImageDis(bean);
	}

	@Override
	public Integer updateImageDis(ImageDisplayBean bean) {
		return imageDisDao.updateImageDis(bean);
	}

	@Override
	public List<ImageDisplayBean> getImageDis(ImageDisplayBean bean) {
		if(bean.getPageNum() !=null) {
			PageHelper.startPage(bean.getPageNum(), bean.getPageSize());
		}
		
		return imageDisDao.getImageDis(bean);
	}

}
